﻿using Kanban.DALContainer;
using Kanban.IBLL;
using Kanban.IDal;
using Kanban.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Kanban.BLL
{
    public class InterfaceDefaultService : BaseService<InterfaceDefault>, IInterfaceDefaultService
    {
        private readonly IInterfaceDefaultDal InterfaceDefaultDal = Container.Resolve<IInterfaceDefaultDal>();

        public Task<Tuple<IList<object>, int>> GetSysConfigPageData(string search, int pageSize, int pageIndex)
        {
            return InterfaceDefaultDal.GetSysConfigPageData(search, pageSize, pageIndex);
        }

        public override void SetCurrentDal()
        {
            Dal = InterfaceDefaultDal;
        }
        public async Task<bool> Save(InterfaceDefault model)
        {
            var query = await GetModelAsync(model.Id);
            query.Value = model.Value;
            query.MEMO = model.MEMO;
            query.ModifyDt = DateTime.Now;
            return await UpdateAsync(query) > 0;

        }
    }
}
